//
//  Person+name.m
//  利用runtime为分类添加成员变量
//
//  Created by xiakexing on 2018/4/16.
//  Copyright © 2018年 xiakexing. All rights reserved.
//

#import "Person+name.h"

#import <objc/runtime.h>
@implementation Person (name)

- (void)setName:(NSString *)name{
    objc_setAssociatedObject(self, @selector(name), name, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (NSString *)name{
    return objc_getAssociatedObject(self, @selector(name));
}

@end
